/**
	@file div.S
	@author Andrew D. Zonenberg
	@brief Test of the divider
 */
 
.set noreorder					/*	Prevent any optimizations from reordering instructions!
									We want exe to exactly match source! */

.section .startup.bootvec, "ax", @progbits 
.globl _start
_start:
		
	li			$t0, 0xDEADBEEF		/* -559,038,737 / 49,374 = -11322 R -26309 = FFFFD3C6 R FFFF993B */
	li			$t1, 0xC0DE
	div			$zero, $t0, $t1		/* Divide them */
	mfhi		$t0
	mflo		$t1
	
	
	li			$t0, 0xDEADBEEF
	li			$t1, 0xC0DE
	divu		$zero, $t0, $t1		/* 3,735,928,559 / 49,374 = 75,665 R 44,849 = 00012791 R 0000AF31 */
	
	la			$t0, .printleds
	jalr		$t0
										
.infloop:							/*	Infinite loop
										tests j instruction */
	j			.infloop

.printleds:
	la			$t0, LEDBANKA
	li			$t1, 0xAA
	sw			$t1, 0($t0)
	jr			$ra
